import http from '../utils/request'

//根据房屋ID获取详细
export const getHouseInfo = params => {
  return http.request({
    url: `/house/tHouse/info`,
    method: 'get',
    params
  })
}
// 
//管理端获取房源列表
export const getHouseList = data => {
  return http.request({
    url: `/house/manage/getHouseModelList`,
    method: 'post',
    data: JSON.stringify(data)
  })
}
/**
 * 房间信息
 * **/
//删除
export const houseRemove = params => {
  return http.request({
    url: `/house/tHouseroom/remove`,
    method: 'get',
    params
  })
}
//修改房源
export const updateHouse = data => {
  return http.request({
    url: `/house/tHouseroom/update`,
    method: 'post',
    data: JSON.stringify(data)
  })
}
//添加房间
export const save = data => {
  return http.request({
    url: `/house/tHouseroom/save`,
    method: 'post',
    data: JSON.stringify(data)
  })
}

/**
 * 房源信息
 * **/
//添加房源
export const addHouse = data => {
  return http.request({
    url: `/house/tHouse/save`,
    method: 'post',
    data: JSON.stringify(data)
  })
}
// 修改房源
export const updateHouseAddress = data => {
  return http.request({
    url: `/house/tHouse/updateHouseAddress`,
    method: 'post',
    data: JSON.stringify(data)
  })
}
//模糊获取小区名称
export const checkCommunity = data => {
  return http.request({
    url: `/house/tHouse/TCommunityListLike`,
    method: 'post',
    data: JSON.stringify(data)
  })
}

/**
 * 合同
*/
//生成房屋合同
export const addContract = data => {
  return http.request({
    url: `/house/tHousecontract/save`,
    method: 'post',
    data: JSON.stringify(data)
  })
}

export const saveecontract = data => {
  return http.request({
    url: `/house/tHousecontract/saveecontract`,
    method: 'post',
    data: JSON.stringify(data)
  })
}

export const saveflexiblecontractV2 = data => {
  return http.request({
    url: `/house/tHousecontract/saveflexiblecontract`,
    method: 'post',
    data: JSON.stringify(data)
  })
}



export const confirmcontract = data => {
  return http.request({
    url: `/house/tHousecontract/confirmcontractNew`,
    method: 'post',
    data: JSON.stringify(data)
  })
}


/**
 * 延长授权模块
*/
//获取延长授权的信息
export const getExtendHouseInfo = params => {
  return http.request({
    url: `/house/manage/getExtendHouseInfo`,
    method: 'get',
    params
  })
}
//延长授权
export const ExtendHouseInfo = params => {
  return http.request({
    url: `/house/manage/ExtendHouseInfo`,
    method: 'get',
    params
  })
}
//绑定门锁
export const bindLockNumber = params => {
  return http.request({
    url: `/house/manage/bindLockNumber`,
    method: 'get',
    params
  })
}

//根据ID查询合同详细
export const getContract = params => {
  return http.request({
    url: `/house/tHousecontract/infoWid`,
    method: 'get',
    params
  })
}

//根据ID查询合同详细
export const bindPowerSn = params => {
  return http.request({
    url: `/house/manage/bindPowerSn`,
    method: 'get',
    params
  })
}

//根据ID查询合同详细
export const getDeptPayState = params => {
  return http.request({
    url: `/house/manage/getDeptPayState`,
    method: 'get',
    params
  })
}
//V2.0-温馨提示 下一次交租日期
export const GetNextTime = params => {
  return http.request({
    url: `/house/tHousecontract/GetNextTime`,
    method: 'POST',
    params
  })
}